{
  "properties" : { },
  "id" : "f8694a3be2e84b0d83fb65645ef36547",
  "script" : null,
  "groupId" : "ebf0447965bd4a6fba9d8f9b1d37abe7",
  "name" : "查询已绑定的巡检范围",
  "createTime" : 1727071104005,
  "updateTime" : 1726284527142,
  "lock" : "0",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "queryBind",
  "method" : "GET",
  "parameters" : [ {
    "name" : "taskId",
    "value" : "1819188656790945793",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": []\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }
}
================================
var sql = """
     SELECT
	r.device_id,
	d.DEVICE_NAME,
	d.ip,
	dept.dept_name deptName 
FROM
	ndmp_audit_range r
	LEFT JOIN ndmp_device d ON r.device_id = d.
	ID LEFT JOIN blade_dept dept ON d.dcc_id = dept.ID 
WHERE
	r.task_id = #{taskId}
	  <if test="deviceName != null and deviceName != ''">
		AND (
			d.device_name LIKE concat ( '%', #{deviceName}, '%' ) 
			OR d.ip LIKE concat ( '%',#{deviceName}, '%' ) 
		OR dept.dept_name LIKE concat ( '%', #{deviceName}, '%' ) 
		)
	  </if>
 """


return db.page(sql)